package com.xteam.xnetworkdisk.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xteam.xnetworkdisk.dto.FilePageByTypeDTO;
import com.xteam.xnetworkdisk.dto.FilePageDTO;
import com.xteam.xnetworkdisk.dto.FileRenameDTO;
import com.xteam.xnetworkdisk.sys.entity.FileEntity;
import com.xteam.xnetworkdisk.utils.R;
import com.xteam.xnetworkdisk.vo.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 
 *
 * @author xiaozhiyong
 * @email xiaozhiyong03@gmail.com
 * @date 2024-08-09 22:08:10
 */
public interface FileService extends IService<FileEntity> {

    R filePageQuery(FilePageDTO filePageDTO);

    void rename(FileRenameDTO fileRenameDTO);

    R upload(MultipartFile file, String md5Value, Integer folderId);

    R deleteFile(List<Integer> fileId);

    R deleteFileTry(List<Integer> fileId);
    void fileView(Integer fileId, HttpServletResponse response);

    R getDir(Integer fileId, Integer userid);

    R listPageByType(FilePageByTypeDTO filePageByTypeDTO, Integer userid);

    R moveFile(MoveFileVO moveFileVO);

    R createFolder(CreateFolderVO createFolderVO, Integer userid);

    R createDownloadLink(String fileId);

    R sendFileByEmail(SendFileByEmailVO fileId);

    R instantUpload(InstantUploadVO InstantUploadVO);

    R uploadChunk(MultipartFile file, String md5Value, Integer folderId, Integer index, Integer chunks, String fileName, Long fileSize, Integer userid);

    R recover(List<Integer> fileId);

    R getRecycleBin(Integer userid);

    R determineUploadStrategy(String md5Value);

    R canselUpload(CanselUploadVO canselUploadVO);

    R judgePreview(String md5);
}

